package com.qf.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResultMsg {
    private int code;
    private String msg;
    private Object data;
    private long count;

    public static ResultMsg FAILED(int code){
        return new ResultMsg(code,null,null,0);
    }

    public static ResultMsg FAILED(int code,String msg){
        return new ResultMsg(code,msg,null,0);
    }

    public static ResultMsg SUCCESS(){
        return new ResultMsg(0,null,null,0);
    }

    public static ResultMsg SUCCESS(Object data){
        return new ResultMsg(0,null,data,0);
    }

    public static ResultMsg SUCCESS(int code,Object data,long count){
        return new ResultMsg(0,null,data,count);
    }
}
